import request from '@/assets/utils/request'

/**
 * 用户登录相关操作
 */

// 用户登录
export const userLogin = (data) => {
  return request({
    method: 'POST',
    url: '/frame/login',
    data
  })
}

// 获取用户列表
export const getUserList = params => {
  return request({
    method: 'GET',
    url: '/users',
    params
  })
}

// 添加用户
export const addUser = data => {
  return request({
    method: 'POST',
    url: '/users',
    data
  })
}

// 编辑用户
export const editUser = (userId, data) => {
  return request({
    method: 'PUT',
    url: `/users/${userId}`,
    data
  })
}

// 删除用户
export const deleteUser = userId => {
  return request({
    method: 'DELETE',
    url: `/users/${userId}`
  })
}
